<template>
  <view class='productList'>
    <uv-notify ref="notify" message="success" type="success"></uv-notify>
    <view class="body-page">
      <uv-gap height="10" bgColor=""></uv-gap>
      <uv-form labelWidth="80" labelPosition="left" :model="product.description" ref="form">
        <uv-form-item label=" " labelWidth="0" prop="content" borderBottom>
          <uv-textarea v-model="product.description" placeholder="闲置物品介绍说明..."></uv-textarea>
        </uv-form-item>

        <uv-form-item label=" "  labelWidth="0" prop="images" borderBottom>
          <UvUpload @uploadChange="uploadSuccess" :dataList="product.images?product.images:[]"/>
        </uv-form-item>

        <uv-form-item required label="价格" prop="amount" borderBottom>
          <view style="width: 100%">
            <view>
              <uv-input border="bottom" type="digit" @blur="amountInputChange" v-model="product.price" placeholder="酬劳"
                        prefixIcon="https://minio.thisforyou.cn:1443/test/金额.png"
              >
              </uv-input>
            </view>
          </view>
        </uv-form-item>


        <uv-form-item required label="物品名称" prop="productName" borderBottom>
          <uv-input border="bottom" v-model="product.productName" placeholder="物品名称"></uv-input>
        </uv-form-item>


        <uv-form-item required label="联系电话" prop="userPhone" borderBottom>
          <uv-input border="bottom" v-model="product.userPhone" placeholder="联系电话"></uv-input>
        </uv-form-item>

        <uv-form-item label="联系微信" prop="wechatId" borderBottom>
          <uv-input border="bottom" v-model="product.wechatId" placeholder="联系微信"></uv-input>
        </uv-form-item>

        <uv-form-item required label="物品类型" prop="destination" borderBottom>
          <uv-input border="bottom" :readonly="true" placeholder="" v-model="product.typeName">
            <template v-slot:prefix>
              <uv-text
                  @click="selectProductType()"
                  text="点击选择"
                  margin="0 3px 0 0"
                  type="tips"
              ></uv-text>
            </template>
          </uv-input>
        </uv-form-item>
      </uv-form>
      <view class="submitBtn">
        <uv-button text="提交" @click="submit"
                   :color="'linear-gradient(to right,' +themConfig.theme.subColor+', '+themConfig.theme.color+')'"></uv-button>
      </view>
      <uv-gap height="80" bgColor=""></uv-gap>
    </view>

    <uv-picker ref="picker" keyName="name" :columns="[productTypes]" @confirm="productTypeConfirm"></uv-picker>
  </view>
</template>


<script>

import {mixins} from './index.js'
import UvUpload from '@/components/school/uv-upload';

export default {
  components: {
    UvUpload
  },
  mixins: [mixins]
}
</script>
<style scoped lang="scss">
@import './index.scss';


* {
  background-color: white !important;
}

.productList {
  padding: 20px;
  background-color: white;
}
</style>
